package com.projet.erp;

import java.sql.Connection;
import java.sql.DriverManager;

public class MES {
    /**
     * 驱动
     */
    private static String driver = "com.mysql.cj.jdbc.Driver";

    /**
     * 地址
     */
    private static String url = "jdbc:mysql://36.135.17.253:28995/imsp_order_system?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true";

    /**
     * 名称
     */
    private static String username = "root";

    /**
     * 密码
     */
    private static String password = "QP*imsp666*8";

    /**
     * 取得连接
     *
     * @return
     */
    public synchronized static Connection getConn() throws Exception {
        //创建连接
        Class.forName(driver);
        return DriverManager.getConnection(url, username, password);

    }

}
